<template>
  <div class="child">
    <h3>我是child组件(子),{{x.name}}</h3>
    <Son/>
  </div>
</template>
<script>
import {inject} from 'vue'
import Son from './Son.vue'
export default {
  name:'Child',
  components:{Son},
  setup(){
   let x =  inject('car')
   console.log(x,'***');
   return {x}
  }
}
</script>
<style>
  .child{
    background-color: blueviolet;
    padding: 10px;
  }
</style>